<template>
    <el-tabs v-model="activeName" @tab-click="handleClick"
        v-if="isShow(['kanke:textbook:classcourse:list-all', 'kanke:textbook:classcourse:list-my'])">
        <el-tab-pane label="所有班级" name="all" v-if="hasPermission('kanke:textbook:classcourse:list-all')">
            <TabPane :type="activeName" v-if="activeName == 'all'" />
        </el-tab-pane>
        <el-tab-pane label="我的班级" name="my" v-if="hasPermission('kanke:textbook:classcourse:list-my')">
            <TabPane :type="activeName" v-if="activeName == 'my'" />
        </el-tab-pane>
    </el-tabs>
</template>
<script>
import { hasPermission, isShow } from '@/common/permission';
import TabPane from './components/TabPane.vue';

export default {
    name: "KanKeTextbookClassList",
    components: {
        TabPane
    },
    data() {
        return {
            activeName: 'all'
        }
    },
    methods: {
        hasPermission,
        isShow,
        handleClick(tab, event) {
            this.activeName = tab.name
        }
    }

}
</script>
<style lang="scss" scoped></style>